home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / AIncludes / SlotEqu.a < prev    next >
Encoding:
Text File  |  1989-10-13  |  12.0 KB  |  518 lines  |  [TEXT/MPS ]

  1. ; Version: 2.54
  2. ; Created: Thursday, August 3, 1989 at 6:28:07 PM
  3. ;
  4. ; File: SlotEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1986-1988
  8. ; All Rights Reserved
  9. ;
  10. ;--------------------------------------------------------------------
  11.  
  12.  
  13. ; sInfo Array status flags (StatusFlags) in bit numbers.
  14. fDontUse        EQU         0                        ; old slotmgr put fcardIsChanged here
  15. fCardIsChanged    EQU         1                        ;Card is Changed field in StatusFlags field of sInfoArray
  16. fTempEnabled    EQU         2                        ; slot is temporarily enabled
  17.  
  18. ; spBlock flags (spFlags).
  19. fCkForNext        EQU         $00                     ;For SearchSRT. Flag to check for NEXT sResource in the table.
  20. fCkReserved     EQU         $01                     ;For ReadPBSize. Flag to check reserved field for zero.
  21. fWarmStart        EQU         $02                     ;If this bit is set then warm start, else cold start.
  22. fClear            EQU         $03                     ;If this bit is set then clear the memory
  23. fSys            EQU         $04                     ;If this bit is set then allocate memory on the system heap.
  24. fConsecBytes    EQU         $05                     ;If this bit is set then Calculate step value for consecutive bytes.
  25.  
  26. ; flag bits for spParamData
  27.  
  28. fAll            EQU         0                        ; bit 0: set=search enabled/disabled sRsrc's
  29. fOneSlot        EQU         1                        ;  1: set=search sRsrc's in given slot only
  30. fNext            EQU         2                        ;  2: set=search for next sRsrc
  31. ; sResource flags (sRsrc_Flags).
  32. fOpenAtStart    EQU         1                        ;If this bit is set then open the driver at start time, else do not.
  33. f32BitMode        EQU         2                        ;If this bit is set then a 32-bit address will be put into dctlDevBase.
  34.  
  35. ;State constants
  36.  
  37. stateNil        EQU         0                        ;State :Nil
  38. stateSDMInit    EQU         1                        ; :Slot declaration manager Init
  39. statePRAMInit    EQU         2                        ; :sPRAM record init
  40. statePInit        EQU         3                        ; :Primary init
  41. stateSInit        EQU         4                        ; :Secondary init
  42.  
  43.  
  44. ;Misc constants 
  45.  
  46. sizeSPRAMRec    EQU         8                        ;Size of sPRAM record
  47. smPRAMTop        EQU         $46                     ;Address of top of slot mgr PRAM area.
  48. majorSpace        EQU         $90                     ; high byte of beginning of major space
  49. TotalSlots        EQU         15                        ; number of slot supported
  50. minorLast        EQU         $FEFFFFFF                ; last minor slot addr
  51. FirstPRAMSlot    EQU         $9                        ; First slot with PRAM allocated
  52. sNumSlots        EQU         6                        ;number of slots
  53. sFirstSlot        EQU         $9                        ;First slot
  54. sLastSlot        EQU         sFirstSlot+sNumSlots-1      ;The last slot.
  55. minorStep        EQU         $01000000                ; value to step minor address to next slot
  56. retryCnt        EQU         100                     ; times to retry read before considered a NuBus error
  57. lastSDMSelt     EQU         $3D                     ;The last SDM selector.
  58.  
  59. ;Data Structures
  60.  
  61. SlotIntQElement   RECORD    0
  62. sqLink            DS.L        1                        ; Ptr - ptr to next element
  63. sqType            DS.W        1                        ; INTEGER - queue type ID for validity
  64. sqPrio            DS.W        1                        ; INTEGER - priority
  65. sqAddr            DS.L        1                        ; ProcPtr - interrupt service routine
  66. sqParm            DS.L        1                        ; LONGINT - optional A1 parameter
  67. sqHDSize        EQU         *                        ; size of slot queue header element
  68.                 ENDR
  69.  
  70.  
  71. SpBlock         RECORD        0                        ;SDM parameter block.
  72. spResult        DS.L        1                        ; FUNCTION Result. [Used by: every function]
  73. spSPointer        DS.L        1                        ; Structure pointer (A structure is a list, long, logical block, ...)
  74. spSize            DS.L        1                        ; Size of structure
  75. spOffsetData    DS.L        1                        ; Offset/Data field. [Used by:sOffsetData]
  76. spIOFileName    DS.L        1                        ; Pointer to IOFile name. [Used by sDisDrvrName]
  77. spSExecPBlk     DS.L        1                        ; Pointer to sExec parameter block. <C468>
  78. spParamData     DS.L        1                        ; misc parameter data (formerly spStackPtr)
  79. spMisc            DS.L        1                        ; Misc field for SDM. <C468>
  80. spReserved        DS.L        1                        ; Reserved for future expansion
  81. spIOReserved    DS.W        1                        ; Reserved field of Slot Resource Table <C663>
  82. spRefNum        DS.W        1                        ; RefNum
  83. spCategory        DS.W        1                        ; sType: Category <C663>
  84. spCType         DS.W        1                        ; Type <C663>
  85. spDrvrSW        DS.W        1                        ; DrvrSW <C663>
  86. spDrvrHW        DS.W        1                        ; DrvrHW <C663>
  87. spTBMask        DS.B        1                        ; Type bit mask (Bits 0..3 determine which words 0..3 to mask). <C663>
  88. spSlot            DS.B        1                        ; Slot number.
  89. spId            DS.B        1                        ; Structure Id.
  90. spExtDev        DS.B        1                        ; Id of the external device.
  91. spHwDev         DS.B        1                        ; Id of the hardware device.
  92. spByteLanes     DS.B        1                        ; Bytelanes value from FHeader in the declaration ROM.
  93. spFlags         DS.B        1                        ; Flags passed to various routine which require them (sSearchSRT,_InitSDeclMgr,...
  94. spKey            DS.B        1                        ; Internal use only.
  95.                 ALIGN        2
  96. spBlockSize     EQU         *                        ; Size of spBlock
  97.                 ENDR
  98.  
  99.  
  100.  
  101. ;--- Record data types
  102. SInfoRecord     RECORD        0                        ;Slot information record. sInfo Array[1..NumSlots]
  103. siDirPtr        DS.L        1                        ; Pointer to directory
  104. siInitStatusA    DS.W        1                        ; Fundamental Error
  105. siInitStatusV    DS.W        1                        ; Status returned by vendor Init code
  106. siState         DS.B        1                        ; Initialization State (Primary, Secondary)
  107. siCPUByteLanes    DS.B        1                        ; CPU Byte Lanes. Each bit set signifies a byte-lane used.
  108. siTopOfROM        DS.B        1                        ; Top of ROM = $FssFFFFx, where x is TopOfROM.
  109. siStatusFlags    DS.B        1                        ; Bit-0:Card is changed
  110. siTOConst        DS.W        1                        ; Time Out Constant for BusErr
  111. siReserved        DS.B        2                        ; Reserved, must be 0
  112. sInfoRecSize    EQU         *                        ; Size of sInfoRecord
  113. siROMAddr        DS.L        1                        ; Address of top of ROM (major or minor space)
  114. siSlot            DS.B        1                        ; slot number
  115. siPadding        DS.B        3                        ; padding to bring out to next long
  116. sInfoNewSize    EQU         *                        ; size of new sInfo record
  117.                 ENDR
  118.  
  119.  
  120.  
  121.  
  122. SDMRecord        RECORD        0                        ;SDM information record. sInfo Array[0]
  123. sdBEVSave        DS.L        1                        ; Save old BusErr vector.
  124. sdBusErrProc    DS.L        1                        ; Go here to determine if it is a BusErr.
  125. sdErrorEntry    DS.L        1                        ; Go here if BusErrProc determines it is really a BusErr.
  126. sdReserved        DS.L        1                        ; Reserved
  127. sdRecSize        EQU         *                        ; Size of SDM information Record.
  128.                 ENDR
  129.  
  130.  
  131.  
  132.  
  133. FHeaderRec        RECORD        0
  134. fhDirOffset     DS.L        1                        ;Offset to directory
  135. fhLength        DS.L        1                        ;Length of ROM
  136. fhCRC            DS.L        1                        ;CRC
  137. fhROMRev        DS.B        1                        ;Revision of ROM
  138. fhFormat        DS.B        1                        ;Format-2
  139. fhTstPat        DS.L        1                        ;TestPattern
  140. fhReserved        DS.B        1                        ;Reserved
  141. fhByteLanes     DS.B        1                        ;ByteLanes
  142. fhBlockSize     EQU         *
  143.                 ENDR
  144.  
  145.  
  146.  
  147. OffsetToDir     EQU         FHeaderRec.fhDirOffset-FHeaderRec.fhBlockSize+1 
  148.                                                         ; offset to dir ptr
  149.  
  150. SEBlock         RECORD        0                        ;Parameter block for code executed by sExec.
  151. ;------- elements of all seBlocks ------
  152. seSlot            DS.B        1                        ; Slot number.
  153. seSRsrcId        DS.B        1                        ; sResource Id.
  154. seStatus        DS.W        1                        ; Status of code executed by sExec.
  155. seFlags         DS.B        1                        ; Flags.
  156. seFiller        DS.B        3                        ; Filler
  157. ;------- extensions for sLoad + sBoot ------
  158. seResult        DS.L        1                        ; Result of sLoad.
  159. seIOFileName    DS.L        1                        ; Pointer to IOFile name.
  160. seDevice        DS.B        1                        ; Which device to read from.
  161. sePartition     DS.B        1                        ; The partition.
  162. seOSType        DS.B        1                        ; Type of OS.
  163. seReserved        DS.B        1                        ; Reserved field.
  164. seRefNum        DS.B        1                        ; RefNum of the driver.
  165. ;------- extensions for sBoot ------
  166. seNumDevices    DS.B        1                        ; Number of devices to load.
  167. seBootState     DS.B        1                        ; State of StartBoot code.
  168.                 ALIGN        2
  169. seBlockSize     EQU         *                        ; Size of se parameter Block
  170.                 ENDR
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177. ; Slot Manager Selectors:
  178. ;
  179. ; PRINCIPLE
  180. sReadByte        EQU         $00
  181. sReadWord        EQU         $01
  182. sReadLong        EQU         $02
  183. sGetCString     EQU         $03
  184. sGetBlock        EQU         $05
  185. sFindStruct     EQU         $06
  186. sReadStruct     EQU         $07
  187. sVersion        EQU         $08
  188. sSetsRsrcState    EQU         $09
  189. sInsertSRTRec    EQU         $0A
  190. sGetsRsrc        EQU         $0B
  191. sGetTypesRsrc    EQU         $0C
  192.  
  193. ; SPECIAL
  194. sReadInfo        EQU         $10
  195. sReadPRAMRec    EQU         $11
  196. sPutPRAMRec     EQU         $12
  197. sReadFHeader    EQU         $13
  198. sNextSRsrc        EQU         $14
  199. sNextTypeSRsrc    EQU         $15
  200. sRsrcInfo        EQU         $16
  201. sDisposePtr     EQU         $17
  202. sCkCardStat     EQU         $18
  203. sReadDrvrName    EQU         $19
  204. sFindSRTRec     EQU         $1A
  205. sFindDevBase    EQU         $1B
  206. sFindBigDevBase   EQU        $1C
  207. sGetsRsrcPtr    EQU         $1D
  208.  
  209. ; Advanced
  210. initSDeclMgr    EQU         $20
  211. sPrimaryInit    EQU         $21
  212. sCardChanged    EQU         $22
  213. sExec            EQU         $23
  214. sOffsetData     EQU         $24
  215. sInitPRAMRecs    EQU         $25
  216. sReadPBSize     EQU         $26
  217. sNewPtr         EQU         $27
  218. sCalcStep        EQU         $28
  219. sInitSRsrcTable   EQU        $29
  220. sSearchSRT        EQU         $2A
  221. sUpdateSRT        EQU         $2B
  222. sCalcSPointer    EQU         $2C
  223. sGetDriver        EQU         $2D
  224. sPtrToSlot        EQU         $2E
  225. sFindSInfoRecPtr  EQU        $2F
  226. sFindSRsrcPtr    EQU         $30
  227. sDeleteSRTRec    EQU         $31
  228. sSecondaryInit    EQU         $32
  229. sInitSlotPRAM    EQU         $33
  230.  
  231.  
  232. ;#####################################################################
  233. ; PRINCIPLE
  234. ;#####################################################################
  235.  
  236.                 MACRO
  237.                 _SReadByte
  238.                 MOVEQ        #sReadByte,D0
  239.                 _SlotManager
  240.                 ENDM
  241.  
  242.                 MACRO
  243.                 _SReadWord
  244.                 MOVEQ        #sReadWord,D0
  245.                 _SlotManager
  246.                 ENDM
  247.  
  248.                 MACRO
  249.                 _SReadLong
  250.                 MOVEQ        #sReadLong,D0
  251.                 _SlotManager
  252.                 ENDM
  253.  
  254.                 MACRO
  255.                 _SGetCString
  256.                 MOVEQ        #sGetCString,D0
  257.                 _SlotManager
  258.                 ENDM
  259.  
  260.                 MACRO
  261.                 _SGetBlock
  262.                 MOVEQ        #sGetBlock,D0
  263.                 _SlotManager
  264.                 ENDM
  265.  
  266.                 MACRO
  267.                 _SFindStruct
  268.                 MOVEQ        #sFindStruct,D0
  269.                 _SlotManager
  270.                 ENDM
  271.  
  272.                 MACRO
  273.                 _SReadStruct
  274.                 MOVEQ        #sReadStruct,D0
  275.                 _SlotManager
  276.                 ENDM
  277.  
  278.                 MACRO
  279.                 _SVersion
  280.                 MOVEQ        #sVersion,D0
  281.                 _SlotManager
  282.                 ENDM
  283.  
  284.                 MACRO
  285.                 _SetsRsrcState
  286.                 MOVEQ        #sSetsRsrcState,D0
  287.                 _SlotManager
  288.                 ENDM
  289.  
  290.                 MACRO
  291.                 _InsertSRTRec
  292.                 MOVEQ        #sInsertSRTRec,D0
  293.                 _SlotManager
  294.                 ENDM
  295.  
  296.                 MACRO
  297.                 _GetsRsrc
  298.                 MOVEQ        #sGetsRsrc,D0
  299.                 _SlotManager
  300.                 ENDM
  301.  
  302.                 MACRO
  303.                 _GetTypesRsrc
  304.                 MOVEQ        #sGetTypesRsrc,D0
  305.                 _SlotManager
  306.                 ENDM
  307.  
  308.  
  309. ;#####################################################################
  310. ; SPECIAL
  311. ;#####################################################################
  312.                 MACRO
  313.                 _SReadInfo
  314.                 MOVEQ        #sReadInfo,D0
  315.                 _SlotManager
  316.                 ENDM
  317.  
  318.                 MACRO
  319.                 _SReadPRAMRec
  320.                 MOVEQ        #sReadPRAMRec,D0
  321.                 _SlotManager
  322.                 ENDM
  323.  
  324.                 MACRO
  325.                 _SPutPRAMRec
  326.                 MOVEQ        #sPutPRAMRec,D0
  327.                 _SlotManager
  328.                 ENDM
  329.  
  330.                 MACRO
  331.                 _SReadFHeader
  332.                 MOVEQ        #sReadFHeader,D0
  333.                 _SlotManager
  334.                 ENDM
  335.  
  336.                 MACRO
  337.                 _SNextSRsrc
  338.                 MOVEQ        #sNextsRsrc,D0
  339.                 _SlotManager
  340.                 ENDM
  341.  
  342.                 MACRO
  343.                 _SNextTypeSRsrc
  344.                 MOVEQ        #sNextTypeSRsrc,D0
  345.                 _SlotManager
  346.                 ENDM
  347.  
  348.                 MACRO
  349.                 _SRsrcInfo
  350.                 MOVEQ        #sRsrcInfo,D0
  351.                 _SlotManager
  352.                 ENDM
  353.  
  354.                 MACRO
  355.                 _SDisposePtr
  356.                 MOVEQ        #sDisposePtr,D0
  357.                 _SlotManager
  358.                 ENDM
  359.  
  360.                 MACRO
  361.                 _SCkCardStat
  362.                 MOVEQ        #sCkCardStat,D0
  363.                 _SlotManager
  364.                 ENDM
  365.  
  366.                 MACRO
  367.                 _SReadDrvrName
  368.                 MOVEQ        #sReadDrvrName,D0
  369.                 _SlotManager
  370.                 ENDM
  371.  
  372.                 MACRO
  373.                 _FindSRTRec
  374.                 MOVEQ        #sFindSRTRec,D0
  375.                 _SlotManager
  376.                 ENDM
  377.  
  378.                 MACRO
  379.                 _SFindDevBase
  380.                 MOVEQ        #sFindDevBase,D0
  381.                 _SlotManager
  382.                 ENDM
  383.  
  384.                 MACRO
  385.                 _SFindBigDevBase
  386.                 MOVEQ        #sFindBigDevBase,D0
  387.                 _SlotManager
  388.                 ENDM
  389.  
  390.                 MACRO
  391.                 _GetsRsrcPtr
  392.                 MOVEQ        #sGetsRsrcPtr,D0
  393.                 _SlotManager
  394.                 ENDM
  395.  
  396. ;#####################################################################
  397. ; Advanced
  398. ;#####################################################################
  399.                 MACRO
  400.                 _InitSDeclMgr
  401.                 MOVEQ        #initSDeclMgr,D0
  402.                 _SlotManager
  403.                 ENDM
  404.  
  405.                 MACRO
  406.                 _SPrimaryInit
  407.                 MOVEQ        #sPrimaryInit,D0
  408.                 _SlotManager
  409.                 ENDM
  410.  
  411.                 MACRO
  412.                 _SCardChanged
  413.                 MOVEQ        #sCardChanged,D0
  414.                 _SlotManager
  415.                 ENDM
  416.  
  417.                 MACRO
  418.                 _SExec
  419.                 MOVEQ        #sExec,D0
  420.                 _SlotManager
  421.                 ENDM
  422.  
  423.                 MACRO
  424.                 _SOffsetData
  425.                 MOVEQ        #sOffsetData,D0
  426.                 _SlotManager
  427.                 ENDM
  428.  
  429.                 MACRO
  430.                 _SInitPRAMRecs
  431.                 MOVEQ        #sInitPRAMRecs,D0
  432.                 _SlotManager
  433.                 ENDM
  434.  
  435.                 MACRO
  436.                 _SReadPBSize
  437.                 MOVEQ        #sReadPBSize,D0
  438.                 _SlotManager
  439.                 ENDM
  440.  
  441.                 MACRO
  442.                 _SNewPtr
  443.                 MOVEQ        #sNewPtr,D0
  444.                 _SlotManager
  445.                 ENDM
  446.  
  447.                 MACRO
  448.                 _SCalcStep
  449.                 MOVEQ        #sCalcStep,D0
  450.                 _SlotManager
  451.                 ENDM
  452.  
  453.                 MACRO
  454.                 _SInitSRsrcTable
  455.                 MOVEQ        #sInitSRsrcTable,D0
  456.                 _SlotManager
  457.                 ENDM
  458.  
  459.                 MACRO
  460.                 _SSearchSRT
  461.                 MOVEQ        #sSearchSRT,D0
  462.                 _SlotManager
  463.                 ENDM
  464.  
  465.                 MACRO
  466.                 _SUpdateSRT
  467.                 MOVEQ        #sUpdateSRT,D0
  468.                 _SlotManager
  469.                 ENDM
  470.  
  471.                 MACRO
  472.                 _SCalcSPointer
  473.                 MOVEQ        #sCalcSPointer,D0
  474.                 _SlotManager
  475.                 ENDM
  476.  
  477.                 MACRO
  478.                 _SGetDriver
  479.                 MOVEQ        #sGetDriver,D0
  480.                 _SlotManager
  481.                 ENDM
  482.  
  483.                 MACRO
  484.                 _SPtrToSlot
  485.                 MOVEQ        #sPtrToSlot,D0
  486.                 _SlotManager
  487.                 ENDM
  488.  
  489.                 MACRO
  490.                 _SFindSInfoRecPtr
  491.                 MOVEQ        #sFindSInfoRecPtr,D0
  492.                 _SlotManager
  493.                 ENDM
  494.  
  495.                 MACRO
  496.                 _SFindSRsrcPtr
  497.                 MOVEQ        #sFindSRsrcPtr,D0
  498.                 _SlotManager
  499.                 ENDM
  500.  
  501.                 MACRO
  502.                 _SDeleteSRTRec
  503.                 MOVEQ        #sDeleteSRTRec,D0
  504.                 _SlotManager
  505.                 ENDM
  506.  
  507.                 MACRO
  508.                 _SecondaryInit
  509.                 MOVEQ        #sSecondaryInit,D0
  510.                 _SlotManager
  511.                 ENDM
  512.  
  513.                 MACRO
  514.                 _InitSlotPRAM
  515.                 MOVEQ        #sInitSlotPRAM,D0
  516.                 _SlotManager
  517.                 ENDM
  518.